package org.csmzxy.class2333;
//水仙花数
import java.util.Scanner;
public class ShuiXianHuaSuanFa {
    public static void main(String[] args){
        int a,b,c;
        Scanner myScanner = new Scanner(System.in);
        System.out.println("请输入要判断是否为水仙花数的数：");
        int count = myScanner.nextInt();
        a = count / 100;
        b = count % 100 / 10;
        c = count % 10;
        if (count >=100 && count <=1000){
            if (a*a*a+b*b*b+c*c*c==count){
                System.out.println(count + " 是一个水仙花数!");
            }
            else {
                System.out.println(count + " 不是一个水仙花数!");
            }
        }
        else {
            System.out.println(count +"请输入100~1000之间的整数！");
        }
    }
}